package com.xyy.saas.payment.cores.api;

import com.xyy.saas.payment.cores.bo.*;
import com.xyy.saas.payment.cores.param.*;
import com.xyy.saas.payment.cores.vo.*;

import java.util.List;
import java.util.Map;

/**
 * 交易侧接口 ： 发起支付 ，发起退款 ，发起提现
 * @author wangtianqi
 * @date 2019/11/21 18:02
 */
public interface PaymentOrderApi {

    /**
     * 通知退款完成
     */
    ResultVO<NotifyOfflineRefundBo> notifyOfflineRefund(NotifyOfflineRefundParam notifyOfflineRefundParam);

    /**
     * 有收银台预支付接口
     * @param orderPrepayVo
     * @param sign
     * @return
     */
    @Deprecated
    ResultVO<PrepayBo> prepay4cashier(OrderPrepayVo orderPrepayVo, String sign);

    /**
     * 有收银台预支付接口
     * @param orderPrepayVoV1
     * @param sign
     * @return
     */
    ResultVO<PrepayBo> prepay4cashier(OrderPrepayVoV1 orderPrepayVoV1, String sign);

    /**
     * 有收银台发起支付接口
     * @param orderPayVo
     * @param sign
     * @return
     */
    @Deprecated
    ResultVO<AggregatePayBo> pay4cashier(OrderPayVo orderPayVo, String sign);

    /**
     * 有收银台发起支付接口
     * @param orderPayVo
     * @param sign
     * @return
     */
    ResultVO<AggregatePayBo> pay4cashier(OrderPayVoV1 orderPayVo, String sign);

    /**
     * 退款接口
     * @param orderRefundVo
     * @param sign
     * @return
     */
    @Deprecated
    ResultVO<RefundBo> refund(OrderRefundVo orderRefundVo, String sign);

    /**
     * 退款接口
     * @param orderRefundVo
     * @param sign
     * @return
     */
    ResultVO<RefundBo> refund(OrderRefundVoV1 orderRefundVo, String sign);

    /**
     * 退款查询接口
     * @param refundQueryVo
     * @param sign
     * @return
     */
    @Deprecated
    ResultVO<QueryResultBo> queryRefund(RefundQueryVo refundQueryVo, String sign);

    /**
     * 退款查询接口
     * @param refundQueryVo
     * @param sign
     * @return
     */
    ResultVO<QueryResultBo> queryRefund(RefundQueryVoV1 refundQueryVo, String sign);
    /**
     * 无收银台支付接口
     * 一块钱使用
     * 微信小程序支付 返回值为 MiniPayBo
     * app支付 返回值为AppPayBo
     * @param payVo
     * @param sign
     * @return
     */
    ResultVO pay(PayVo payVo, String sign);

    /**
     * 订单状态查询接口
     * @param orderQueryVo
     * @param sign
     * @return
     */
    @Deprecated
    ResultVO<QueryResultBo> queryPay(OrderQueryVo orderQueryVo, String sign);

    /**
     * 订单状态查询接口
     * @param orderQueryVoV1
     * @param sign
     * @return
     */
    ResultVO<QueryResultBo> queryPay(OrderQueryVoV1 orderQueryVoV1, String sign);
    ResultVO<QueryResultBo> queryPayV2(OrderQueryVoV1 orderQueryVoV1);
    /**
     * 批量查询交易状态接口
     */
    ResultVO<TransactionResultInfoVO> batchQueryTransactionInfo(TransactionQueryParam transactionQueryParam, String sign);

    /**
     * 单查询交易状态接口
     */
    ResultVO<TransactionResultBO> queryTransactionInfo(TransactionParam param, String sign);

    /**
     * 订单状态查询接口
     * @param queryPayVo
     * @param sign
     * @return
     */
    ResultVO<List<QueryPayNoResultBo>> queryPay(QueryPayVo queryPayVo, String sign);

    /**
     * 无收银台支付接口 聚合使用
     * @param pay4noCashierVo
     * @param sign
     * @return
     */
    @Deprecated
    ResultVO<PayBo> pay4noCashier(Pay4noCashierVo pay4noCashierVo, String sign);

    /**
     * 无收银台支付接口 聚合使用
     * @param pay4noCashierVoV1
     * @param sign
     * @return
     */
    ResultVO<PayBo> pay4noCashier(Pay4noCashierVoV1 pay4noCashierVoV1, String sign);

    /**
     * 查询提现单状态
     * @param orderQueryVoV1
     * @param sign
     * @return
     */
    ResultVO<QueryResultBo> queryWithdraw(OrderQueryVoV1 orderQueryVoV1, String sign);

    /**
     * 提现接口
     * @param orderWithdrawVo
     * @param sign
     * @return
     */
    ResultVO<OrderWithdrawalBo> withdraw(OrderWithdrawVo orderWithdrawVo, String sign);

    /**
     * 提现验证
     */
    ResultVO<OrderWithdrawalBo> withdrawAuth(WithdrawAuthVo withdrawAuthVo, String sign);

    /**
     * 查询提现手续费接口
     * @param queryWithdrawalFeeVo
     * @param sign
     * @return
     */
    ResultVO<QueryWithdrawalFeeBo> queryWithdrawalFee(QueryWithdrawalFeeVo queryWithdrawalFeeVo, String sign);

    /**
     * 订单关闭接口
     * @param orderClosedVo
     * @param sign
     * @return
     */
    ResultVO<OrderClosedBo> orderClosed(OrderClosedVo orderClosedVo, String sign);


    /**
     * 发起转账接口 （待结算 -> 用户）
     *  @param separateAccountsVo
     *  @param sign
     *  @return
     */
    ResultVO<SeparateAccountsBo> separateAccounts(SeparateAccountsVo separateAccountsVo, String sign);

    void clearFrozenAmount(List<String> list);

    /**
     * 发起转账接口 (用户 -> 用户)
     *  @param separateAccountFromUserVo
     *  @param sign
     *  @return
     */
    ResultVO<SeparateAccountsBo> separateAccountFromUser(SeparateAccountFromUserVo separateAccountFromUserVo, String sign);

    /**
     * 批量转账接口
     * @param batchSeparateAccountVO
     * @param sign
     * @return
     */
    ResultVO<BatchSeparateAccountsBo> batchSeparateAccount(BatchSeparateAccountVO batchSeparateAccountVO, String sign);

    /**
     * 根据单号查询支付渠道
     * @param queryPayChannelParam
     * @param sign
     * @return
     */
    ResultVO<Map<String, String>> queryPayChannelByOrderNo(QueryPayChannelParam queryPayChannelParam, String sign);

    /**
     * 根据业务提现单号查询支付平台提现流水号
     * @param queryParam
     * @param sign
     * @return
     */
    ResultVO<OrderWithdrawalBo> queryWithdrawNoByBusinessOrderNo(OrderWithdrawalQueryParam queryParam, String sign);

    /**
     * 根据支付平台支付单号/退款单号查询支付/退款凭证（回单），目前仅支持平安银行信用支付
     * @param queryParam
     * @param sign
     * @return
     */
    ResultVO<TradeCertificateBo> queryTradeCertificate(QueryTradeCertificateVo queryParam, String sign);

}
